import request from '@/utils/request'

// 分页查询
export function requestTaskPage(data) {
  return request({
    url: '/jtx/task/management/page',
    method: 'post',
    loading: false,
    data,
  })
}
// 任务保存
export function requestTaskCreate(data) {
  return request({
    url: '/jtx/task/management/save',
    method: 'post',
    loading: false,
    data,
  })
}
// 任务编辑
export function requestTaskUpdate(data) {
  return request({
    url: '/jtx/task/management/update',
    method: 'post',
    loading: false,
    data,
  })
}
// 任务详情
export function requestTaskDetail(params) {
  return request({
    url: '/jtx/task/management/get',
    method: 'get',
    loading: false,
    params,
  })
}
// 任务删除
export function requestTaskDelete(data) {
  return request({
    url: `/jtx/task/management/delete/${data.id}`,
    method: 'post',
    loading: false,
  })
}
// 批量删除
export function requestTaskDeleteBatch(data) {
  return request({
    url: `/jtx/task/management/deleteBatch`,
    method: 'post',
    loading: false,
    data,
  })
}
//任务进展保存
export function requestTaskProgessCreate(data) {
  return request({
    url: '/jtx/task/management/saveProgress',
    method: 'post',
    loading: false,
    data,
  })
}
// 保存任务结论
export function requestTaskConclusionCreate(data) {
  return request({
    url: '/jtx/task/management/saveConclusion',
    method: 'post',
    loading: false,
    data,
  })
}
// 批量下发
export function requestTaskDistribute(data) {
  return request({
    url: '/jtx/task/management/distribute',
    method: 'post',
    loading: false,
    data,
  })
}

// 撤回-关闭
export function requestTaskUpdateStatus(data) {
  return request({
    url: '/jtx/task/management/updateStatus',
    method: 'post',
    loading: false,
    data,
  })
}
// 文件下载
export function fileDownload(params) {
  return request({
    url: '/jtx/task/management/getAttachment',
    method: 'post',
    loading: true,
    params,
    responseType: 'blob',
  })
}
